@model WalkingTec.Mvvm.Mvc.Admin.ViewModels.DataPrivilegeVMs.DataPrivilegeVM
<wt:form vm="@Model">
  <wt:hidden field="DpType" />
  <wt:combobox field="Entity.TableName" items="TableNames" disabled="true" />
  <wt:combobox field="IsAll" change-func="IsAllChange" />
  <wt:row id="selector">
    <wt:selector list-vm="DpList" field="SelectedItemsID" text-bind="DpList.EntityList[0].Name" label-text="" paras="Searcher.TableName=@Model.Entity.TableName">
      <wt:searchpanel vm="DpList">
        <wt:row items-per-row=" ItemsPerRowEnum.Two">
          <wt:textbox field="DpList.Searcher.Filter" />
        </wt:row>
      </wt:searchpanel>
    </wt:selector>
  </wt:row>
  <wt:row id="userrow">
    <wt:textbox field="Entity.UserCode" search-url="/_Admin/FrameworkUser/GetUserById" disabled="true" />
  </wt:row>
  <wt:row id="grouprow">
    <wt:combobox field="Entity.GroupCode" items="AllGroups" disabled="true" />
  </wt:row>
  <br /><br />
  <wt:row align="AlignEnum.Right">
    <wt:submitbutton />
    <wt:closebutton />
  </wt:row>
</wt:form>
<script>
    DbTypeChange({ value: $('#DataPrivilegeVM_DpType').val() });
    IsAllChange({ value: '@Model.IsAll.ToString().ToLower()' });
    function DbTypeChange(data) {
        if (data.value == "UserGroup") {
            $('#userrow').css('display', 'none');
            $('#grouprow').css('display', 'block');
        }
        else {
            $('#userrow').css('display', 'block');
            $('#grouprow').css('display', 'none');
        }
    }
    function IsAllChange(data) {
        if (data.value == 'true') {
            $('#selector').css('display', 'none');
        }
        else {
            $('#selector').css('display', 'block');
        }
    }

</script>

<!-- WTM默认页面 Wtm buidin page-->
